#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<bitset>
using namespace std;

class Solution{
    public:
    uint32_t ans1(uint32_t n){
        uint32_t rev = 0;
        for(int i = 0; i < 32 && n > 0; i++){
            rev = rev | (n & 1) << (31 - i);
            n = n >> 1;
        }

        return rev;
    }

    uint32_t ans2(uint32_t n){
        string n_bin = bitset<32>(n).to_string();
        reverse(n_bin.begin(), n_bin.end());
        return static_cast<uint32_t>(bitset<32>(n_bin).to_ulong());
    }
};

void test(){
    Solution s;
    uint32_t n = 00000010100101000001111010011100;

    uint32_t ret = s.ans1(n);
    cout << ret << endl;
}

int main(void){
    test();

    return 0;
}